Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Make AVIM restartless #132

Closed
wants to merge 33 commits into from
Closed

[WIP] Make AVIM restartless #132

wants to merge 33 commits into from

Conversation

1ec5
Copy link
Owner

@1ec5 1ec5 commented Apr 19, 2015

This PR makes AVIM a restartless extension, migrating it off the trusty old overlays and onto the brave new world of JavaScript-all-the-way-down. It fixes #9, cuts down the extension’s file size, and paves the way to support additional platforms like Android (#131).

  • Load overlays via bootstrap.js instead of XPCOM component (for Gecko 2.0+)
  • Build UI directly in avim.js, bypassing overlays in both bootstrap.js and XPCOM
  • Convert overlay DTD to .properties; load it programmatically
  • Import preferences as subscript
  • Attach common UI elements to app-specific overlay hooks
  • Remove overlays
  • Remove test harness dialog (fixes Convert test harness into a series of unit tests #23), which relies on an overlay
  • Remove overrides specific to skins that are no longer in active development
  • Detach UI and listeners on uninstallation
  • Rebuild UI and listeners on reinstallation
  • Display doorhanger on reinstallation
  • Display doorhanger on overflowed toolbar button (fixes Display doorhanger when toggling AVIM if toolbar button is overflowed #133)
  • Fix toolbar button customization after reinstallation
  • Reimplement about:addons overlay (for Mudim monitor)
  • Reimplement Options window overlay (including fix for Mac menu bar)
  • Close Options window and its sheets on uninstallation
  • Add upgrade path from older avim.js to newer avim.js via bootstrap.js
  • Disable unpacking
  • Test extension when installed via XPI instead of symlink
  • Test in Firefox 31.6 ESR
  • Fix in Firefox 8–10
  • Fix in Firefox 5–7
  • Fix in Firefox 4
  • Fix in Firefox 3.x
  • Fix in Firefox 2
  • Test entire extension lifecycle in Thunderbird, SeaMonkey, Instantbird, Komodo Edit, Nightingale
  • Update Babelzilla Beta
  • Document new architecture

1ec5 added 19 commits April 12, 2015 15:22
Began migrating from declarative XUL overlays to data-driven but nonetheless procedural JavaScript. 😢 Registered resource: aliases to manually import transformer.js as a JavaScript code module instead of an XPCOM component and the preferences file as a subscript, all while hopefully maintaining Firefox 2 compatibility.

The upside is that AVIM will be restartless, and the redundant menu definitions can be combined.

Fixes #9.
Also removed a BOM in the Vietnamese .properties file that broke UI building.
No longer needed now that Travis runs automated tests on the entire FVDP corpus.
Sent from my iPhone
Completely clean up event listeners upon uninstallation. Correctly unload/reload overlay stylesheet. Tear down existing `window.avim` and rebuild it instead of bailing, making in-place upgrades possible.
@1ec5
Copy link
Owner Author

1ec5 commented Apr 19, 2015

May the record note that, though procedural extension programming is what all the cool kids do these days, I will deeply miss the declarative paradigm of XUL overlays and XBL bindings. 😢

1ec5 added 6 commits April 19, 2015 17:37
When the option `toolbar=no` is passed to `window.open()`, the toolbar is hidden except for the most essential items (currently only the Location Bar), so AVIM’s toolbar button should be hidden too.
Add the toolbar button to the `<toolbarpalette>` and work with CustomizableUI.jsm (which is bound to `<toolbar>`) to ensure that it only appears when called for in toolbar preferences.
Ensure that the toolbar button disappears on disable and appears on reenable when it’s in the application menu. Also have the toggle popup point to the toolbar button when it’s on the toolbar.
@1ec5
Copy link
Owner Author

1ec5 commented Apr 28, 2015

Known issues (to be filed separately once this PR gets merged):

  • On the Mac, AVIM menu items don’t appear in the Edit menu while AVIM’s options window or any of its sheets are in front. The keyboard shortcuts still work, though.

1ec5 added 5 commits April 27, 2015 21:40
Building the UI on DOMContentLoaded works again in Australis because we’re using the CustomizeUI API, which is a bit more robust than the raw <toolbar> bindings.
Send return values through lambdas.
@1ec5
Copy link
Owner Author

1ec5 commented Aug 23, 2015

Per #141, AVIM will have to be rewritten another way for Firefox. Some of the work here may be useful going forward, but not the overall set of changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant